<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">微信配置</h4>
</div>
<div class="wrapper-md ng-scope" ng-controller="wechatConfigCtrl">

    <!-- 删除弹窗 -->
    <script type="text/ng-template" id="deleteWechatConfig.html">
        <div ng-include="'tpl/wechat/wechat_config_delete.html'"></div>
    </script>

    <div class="panel panel-default">
        <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline ng-pristine ng-valid">
                    <div class="form-group">
                        <label class="control-label">门店名称</label>
                        <input type="text" ng-model="shop.shopName" class="input-sm form-control">
                    </div>

                    <button ng-click="query()" class="btn btn-sm btn-default">查询</button>
                </form>
            </div>
            <div class="col-sm-3">
                <div class="pull-right">
                    <a class="btn btn-sm btn-info" ui-sref="app.wechatConfigAdd" target="_blank">新增</a>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                    <tr>
                        <th>名称</th>
                        <th>wcId</th>
                        <th>AppID</th>
                        <th>Secret</th>
                        <th>Partner</th>
                        <th>Secret For Pay</th>
                        <th>Is System Config</th>
                        <th width="300" class="text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="w in list">
                        <td ng-if="w.isChain == 0">{{w.shopName}}</td>
                        <td ng-if="w.isChain == 1">{{w.chainName}}</td>
                        <td>{{w.wcId}}</td>
                        <td>{{w.appId}}</td>
                        <td>{{w.secret}}</td>
                        <td>{{w.partner}}</td>
                        <td>{{w.paySecret}}</td>
                        <td>
                            <i class="icon-check text-success m-r-xs" ng-if="w.isSys == 1"></i>
                            <i class="icon-close text-danger m-r-xs" ng-if="w.isSys == 0"></i>
                        </td>
                        <td class="t-btns text-right">
                            <a class="btn btn-sm btn-success" ui-sref="app.wechatConfigView({id:w.id})" target="_blank">查看</a>
                            <button class="btn btn-sm btn-info" ui-sref="app.wechatConfigEdit({id:w.id})">修改</button>
                            <button class="btn btn-sm btn-danger" ng-click="openDelete(w.id,w.shopName)">删除</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 hidden-xs">
                    <!--<button class="btn btn-sm btn-default">批量冻结</button>
                    <button class="btn btn-sm btn-default">批量删除</button>-->
                </div>
                <div class="col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>
</div>
